<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>19-操作className属性</title>
		<style type="text/css">
			.box{
				width:100px;
				height:100px;
				background:red;
			}
			.cur{
				width:200px;
				height:200px;
				background:yellow;
			}
		</style>
	</head>
	<body>
		<div class="box" id='oop'>
			
		</div>
		<script type="text/javascript">
			//元素对象.className = 值
			var i =1;
			document.querySelector('#oop').onclick=function(){
				if(i%2==0){
					this.className = 'box';
				}else{
					this.className = 'cur';
				}
				i++;
			}
			
		</script>
	</body>
</html>
